﻿// 请勿修改，否则可能出错
var Sys = {};
var ua = navigator.userAgent.toLowerCase();
var s;
(s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1]:
    //下一句判断IE11，包含IE9以上版本
    (s = ua.match(/trident\/([\d.]+)/)) ? Sys.ie9 = s[1] :
    (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
    (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
    (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
    (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;

//var classid='8B23EA28-2009-402F-92C4-59BE0E063499'; //JG
//var classid='DC852C85-C2FC-4c86-8D6B-E4E97C92F821';//zz
//var classid = "C9BC4DFF-4248-4a3c-8A49-63A7D317F404"; //平台版本CLSID
//var classid = "A64E3073-2016-4baf-A89D-FFE1FAA10EC1";//2016平台版本改CLSID
//var classid = "A64E3073-2016-4baf-A89D-FFE1FAA10EC0"; //2016平台版本CLSID
//var classid="6AA93C3B-D450-4a80-876E-3909055B0640";
//var classid="6AA93B0B-D450-4a80-876E-3909055B0640";//再改CLSID2
//var classid="A64E3073-2016-4baf-A89D-FFE1FAA10ED0";//2016CLSID企业
var classid = "A39F1330-3322-4a1d-9BF0-0BA2BB90E970";//企业版本CLSID
//var classid = "C39F1330-3322-4a1d-9BF0-0BA2BB90E970";
//var classid = "A64E3073-2016-4baf-A89D-FFE1FAA10EE0";
var controlver = "5,0,3,0"; //控件版本号
if (Sys.ie || Sys.ie9) {
	if(window.navigator.platform == "Win32")
	{
    document.write('<!-- 用来产生编辑状态的ActiveX控件的JS脚本-->   ');
    document.write('<!-- 因为微软的ActiveX新机制，需要一个外部引入的js-->   ');
    document.write('<object id="TANGER_OCX" classid="clsid:' + classid + '" ');
    document.write('codebase="ntko/OfficeControl.cab#version=' + controlver + '" width="100%" height="100%">   ');
	}
	else
	{
    document.write('<!-- 用来产生编辑状态的ActiveX控件的JS脚本-->   ');
    document.write('<!-- 因为微软的ActiveX新机制，需要一个外部引入的js-->   ');
    document.write('<object id="TANGER_OCX" classid="clsid:' + classid64 + '" ');
    document.write('codebase="ntko/OfficeControl64.cab#version=' + controlver + '" width="100%" height="100%">   ');
	}
    document.write('<param name="IsUseUTF8URL" value="-1">   ');
    document.write('<param name="IsUseUTF8Data" value="-1">   ');
    document.write('<param name="BorderStyle" value="1">   ');
    document.write('<param name="BorderColor" value="14402205">   ');
    document.write('<param name="TitlebarColor" value="15658734">   ');
    document.write('<param name="TitlebarTextColor" value="0">   ');
    document.write('<param name="MenubarColor" value="13158600">   ');
    document.write('<param name="MenuButtonColor" VALUE="16180947">   ');
    document.write('<param name="MenuBarStyle" value="3">   ');
    document.write('<param name="MenuButtonStyle" value="7">   ');
    document.write('<param name="WebUserName" value="NTKO">   ');
    document.write('<param name="UILangCode" value="AUTO">   ');
    // document.write('<param name="NoExpireKey" value="594F05B80E0965A6A716D1004C5DA2DB">   ');
    document.write('<param name="Caption" value="NTKO OFFICE文档控件示例演示 http://www.ntko.com">   ');
    document.write('<SPAN STYLE="color:red">不能装载文档控件。请在检查浏览器的选项中检查浏览器的安全设置。请点击<a href="评测专用演示版本970.exe">安装控件</a></SPAN> ');
    document.write('</object>');
} else if (Sys.chrome || Sys.firefox) {
    document.write('<object id="TANGER_OCX" clsid="{' + classid + '}" ');
    document.write('type="application/ntko-plug" codebase="ntko/OfficeControl.cab#version=' + controlver + '" width="100%" height="500px" ');
    document.write('ForOnSaveToURL="OnComplete2" ');
    document.write('ForOnBeginOpenFromURL="OnComplete" ');
    document.write('ForOnDocumentOpened="DocumentOpened" ');
    document.write('ForOnpublishAshtmltourl="publishashtml" ');
    document.write('ForOnpublishAspdftourl="publishaspdf" ');
    document.write('ForOnSaveAsOtherFormatToUrl="saveasotherurl" ');
    document.write('ForOnDoWebGet="dowebget" ');
    document.write('ForOnDoWebExecute="webExecute" ');
    document.write('ForOnDoWebExecute2="WebExecute" ');
    document.write('ForOnFileCommand="filecommand" ');
    document.write('ForOnCustomMenuCmd2="CustomMenuCmd" ');
    document.write('ForOnCustomToolBarCommand="CustomToolBarCom" ');
    document.write('ForOnSignSelect="signselect" ');
    document.write('_IsUseUTF8URL="-1"   ');
    document.write('_IsUseUTF8Data="-1"   ');
    document.write('_BorderStyle="1"   ');
    document.write('_BorderColor="14402205"   ');
    document.write('_MenubarColor="14402205"   ');
    document.write('_MenuButtonColor="16180947"   ');
    document.write('_MenuBarStyle="3"  ');
    document.write('_MenuButtonStyle="7"   ');
    document.write('_WebUserName="NTKO"   ');
    document.write('_CustomToolBar="-1"   ');
    document.write('_Caption=" NTKO OFFICE文档控件示例演示" > ');
    document.write('<SPAN STYLE="color:red">不能装载文档控件。请在检查浏览器的选项中检查浏览器的安全设置。请点击<a href="评测专用演示版本970.exe">安装控件</a></SPAN> ');
    document.write('</object>');
} else if (Sys.opera) {
    alert("sorry,ntko 暂时不支持opera!");
} else if (Sys.safari) {
    alert("sorry,ntko 暂时不支持safari!");
}